#ifndef COMMONDATA_H
#define COMMONDATA_H
#include "BaseData.h"


class CommonData
{
public:
    void setFactoryNo(const std::string& factoryNo){this->factoryNo=factoryNo;}
    void setTransId(const std::string& transId){this->transId=transId;}
    void setEventTime(const std::string& eventTime){this->eventTime=eventTime;}
    void setEventUser(const std::string& eventUser){this->eventUser=eventUser;}
    void setMachineNo(const std::string& machineNo){this->machineNo=machineNo;}
    void setServerUrl(const std::string& serverUrl){this->serverUrl=serverUrl;}
    void setEndPoint(const std::string& endpoint){this->endPoint=endpoint;}
    std::string setApiUrl(const std::string& api){return (this->serverUrl+this->endPoint+api);}

    std::string getFactoryNo()const{return factoryNo;}
    std::string getTransId()const{return transId;}
    std::string getEventTime()const{return eventTime;}
    std::string getEventUser()const{return eventUser;}
    std::string getMachineNo()const{return machineNo;}
    std::string getServerUrl()const{return serverUrl;}
    std::string getEndPoint()const{return endPoint;}

    // void setupNetwork();

private:
    friend class BaseData<CommonData>;

    CommonData()=default;
    //通用配置
    std::string factoryNo;
    std::string transId;
    std::string eventTime;
    std::string eventUser;
    std::string machineNo;

    //系统配置
    std::string serverUrl;
    std::string endPoint = "/api/getech-mes/IotController";
};

#endif // COMMONDATA_H
